<?php

namespace App\Http\Controllers\Mall;


use App\Traits\Mall\CartTrait;
use Illuminate\Http\Request;

class CartController extends BaseController
{
    use CartTrait;

    public function __construct(Request $request)
    {
        parent::__construct($request);
        $this->middleware('auth');
    }

    /**
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function index(Request $request)
    {

        return $this->showCart($request);
    }

    /**
     * @param Request $request
     * @param $shops
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    protected function showCartView(Request $request, $shops)
    {
        return $this->view('mall.cart.index', compact('shops'));
    }
}
